import { defineConfig, optimizeDeps } from 'vite'
import vue from '@vitejs/plugin-vue'
import autoprefixer from 'autoprefixer'
import WindiCSS from 'vite-plugin-windicss'
import {resolve }from 'path'
import legacy from '@vitejs/plugin-legacy'

// https://vitejs.dev/config/
export default defineConfig({
	resolve:{
		alias:{
			"@":resolve('src')
		}
	},
	css: {
		postcss: {
			plugins: [
				autoprefixer(
					{
						overrideBrowserslist: ['Chrome > 40', 'ff > 31', 'ie 11'],
					}
				)
			]
		}
	},

	plugins: [vue(), WindiCSS(),
	// 这里写polyfill的相关设置
	legacy({
		// 目标
		targets:["cover 99.5%"]
	})],
	// 优化什么
	optimizeDeps:{
		include:["core-js"]
	}
})